<template>
    <div class="hello">
      <h1>当前求和为:{{ sum }}</h1>
      <h2>乘以10之后就是:{{bigSum}}</h2>
      <button @click='jiaWait(1)'>延迟+</button>
      <button @click="JIA(1)">直接+</button>
    </div>
  </template>
  
  <script>
    // 引入的方式是不变的，依然是这样引入
  import { mapGetters,mapState } from 'vuex'
  import { mapMutations,mapActions } from 'vuex'
  export default {
    name: 'P115',
    computed:{
      //在使用了模块化的store之后，我们的mapGetters等东西就有了新的用法，请看

      ...mapGetters('countDemo',['bigSum']),
      ...mapState('countDemo',['sum'])
    },
    methods:{
        ...mapActions('countDemo',['jiaWait']),
        ...mapMutations('countDemo',['JIA']),
    }
  }
  </script>
  